package com.yyz.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yyz.domain.User;
import com.yyz.mapper.UserMapper;
import com.yyz.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author yyz
 * @create 2023-07-24 22:11
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    /**
     * 根据条件查询
     * @param lqw
     * @return
     */
    @Override
    public User selectOne(LambdaQueryWrapper<User> lqw) {
        User user = userMapper.selectOne(lqw);
        return user;
    }

    /**
     * 注册新用户
     * @param user
     */
    @Override
    public void inser(User user) {
        userMapper.insert(user);
    }
}
